import type { postOrPutType } from "@/constants";
import type { IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.ts";
const url = "/back/config-type";
/*字典类型：获取字典类型信息 */
export const getDictTypeInfo = <T, D>(params?: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url, params);
};

/* 字典类型：新增，更新字典类型信息 */
export const commonDictTypeInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 字典类型：删除字典信息 */
export const deleteDictTypeInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
